package com.alatus.web;

import com.alatus.NetCrmServerApplication;
import com.alatus.constant.Constants;
import com.alatus.result.Result;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DicController {

    @GetMapping(value = "/api/dicValue/{typeCode}")
    public Result getDicValue(@PathVariable(value = Constants.TYPECODE)String typeCode){
        List<Object> dicValueList = (List<Object>) NetCrmServerApplication.cacheMap.get(typeCode);
        return Result.OK(dicValueList);
    }
}
